//
// Created by Suny on 15/3/30.
// Copyright (c) 2015 Suny. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BaseViewController.h"

@class TableViewController;
@class TableViewCellDisplayInfo;

typedef BOOL(^TableViewControllerSelectedBlock)(TableViewController *tableViewController,NSIndexPath *indexPath);

@interface TableViewController :BaseViewController <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic) UITableViewCellAccessoryType    accessoryType;              // default is UITableViewCellAccessoryNone. use to set standard type

/**
 *  TableView
 */
@property (nonatomic, strong) UITableView *tableView;

/**
 *  数据源 model为  TableViewCellDisplayInfo 的子类
 */
@property (nonatomic, strong) NSMutableArray *modelArray;

/**
*  是否是编辑状态，即是否可是选择状态
*/
@property(nonatomic, assign, getter=isEditing ) BOOL editing;

@property (nonatomic, assign)UITableViewCellEditingStyle cellEditingStyle;

@property (nonatomic, copy)TableViewControllerSelectedBlock selectedBlock;

/**
 *  获取cell的现实信息
 *  可以子类复写 默认从modelArray中获取
 *  
 *  @param indexPath indexPath
 *  
 *  @return 
 */
- (TableViewCellDisplayInfo *)tableView:(UITableView *)tableView 
			 cellDisplayInfoAtIndexPath:(NSIndexPath *)indexPath;


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath withModelInfo:(NSObject *)modelInfo;


- (void)reloadTableView;
@end